\(\int \frac {1}{a+\frac {b}{x^2}} \, dx\) [1849]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 9, antiderivative size = 31 \[ \int \frac {1}{a+\frac {b}{x^2}} \, dx=\frac {x}{a}-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {a} x}{\sqrt {b}}\right )}{a^{3/2}} \]

[Out]

x/a-arctan(x*a^(1/2)/b^(1/2))*b^(1/2)/a^(3/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {199, 327, 211} \[ \int \frac {1}{a+\frac {b}{x^2}} \, dx=\frac {x}{a}-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {a} x}{\sqrt {b}}\right )}{a^{3/2}} \]

[In]

Int[(a + b/x^2)^(-1),x]

[Out]

x/a - (Sqrt[b]*ArcTan[(Sqrt[a]*x)/Sqrt[b]])/a^(3/2)

Rule 199

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[x^(n*p)*(b + a/x^n)^p, x] /; FreeQ[{a, b}, x] && LtQ[n, 0]
 && IntegerQ[p]

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {x^2}{b+a x^2} \, dx \\ & = \frac {x}{a}-\frac {b \int \frac {1}{b+a x^2} \, dx}{a} \\ & = \frac {x}{a}-\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {a} x}{\sqrt {b}}\right )}{a^{3/2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00 \[ \int \frac {1}{a+\frac {b}{x^2}} \, dx=\frac {x}{a}-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {a} x}{\sqrt {b}}\right )}{a^{3/2}} \]

[In]

Integrate[(a + b/x^2)^(-1),x]

[Out]

x/a - (Sqrt[b]*ArcTan[(Sqrt[a]*x)/Sqrt[b]])/a^(3/2)

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.87

method result size
default \(\frac {x}{a}-\frac {b \arctan \left (\frac {a x}{\sqrt {a b}}\right )}{a \sqrt {a b}}\) \(27\)
risch \(\frac {x}{a}+\frac {\sqrt {-a b}\, \ln \left (-\sqrt {-a b}\, x -b \right )}{2 a^{2}}-\frac {\sqrt {-a b}\, \ln \left (\sqrt {-a b}\, x -b \right )}{2 a^{2}}\) \(56\)

[In]

int(1/(a+b/x^2),x,method=_RETURNVERBOSE)

[Out]

x/a-b/a/(a*b)^(1/2)*arctan(a*x/(a*b)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 82, normalized size of antiderivative = 2.65 \[ \int \frac {1}{a+\frac {b}{x^2}} \, dx=\left [\frac {\sqrt {-\frac {b}{a}} \log \left (\frac {a x^{2} - 2 \, a x \sqrt {-\frac {b}{a}} - b}{a x^{2} + b}\right ) + 2 \, x}{2 \, a}, -\frac {\sqrt {\frac {b}{a}} \arctan \left (\frac {a x \sqrt {\frac {b}{a}}}{b}\right ) - x}{a}\right ] \]

[In]

integrate(1/(a+b/x^2),x, algorithm="fricas")

[Out]

[1/2*(sqrt(-b/a)*log((a*x^2 - 2*a*x*sqrt(-b/a) - b)/(a*x^2 + b)) + 2*x)/a, -(sqrt(b/a)*arctan(a*x*sqrt(b/a)/b)
 - x)/a]

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 56 vs. \(2 (26) = 52\).

Time = 0.07 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.81 \[ \int \frac {1}{a+\frac {b}{x^2}} \, dx=\frac {\sqrt {- \frac {b}{a^{3}}} \log {\left (- a \sqrt {- \frac {b}{a^{3}}} + x \right )}}{2} - \frac {\sqrt {- \frac {b}{a^{3}}} \log {\left (a \sqrt {- \frac {b}{a^{3}}} + x \right )}}{2} + \frac {x}{a} \]

[In]

integrate(1/(a+b/x**2),x)

[Out]

sqrt(-b/a**3)*log(-a*sqrt(-b/a**3) + x)/2 - sqrt(-b/a**3)*log(a*sqrt(-b/a**3) + x)/2 + x/a

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.84 \[ \int \frac {1}{a+\frac {b}{x^2}} \, dx=-\frac {b \arctan \left (\frac {a x}{\sqrt {a b}}\right )}{\sqrt {a b} a} + \frac {x}{a} \]

[In]

integrate(1/(a+b/x^2),x, algorithm="maxima")

[Out]

-b*arctan(a*x/sqrt(a*b))/(sqrt(a*b)*a) + x/a

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.84 \[ \int \frac {1}{a+\frac {b}{x^2}} \, dx=-\frac {b \arctan \left (\frac {a x}{\sqrt {a b}}\right )}{\sqrt {a b} a} + \frac {x}{a} \]

[In]

integrate(1/(a+b/x^2),x, algorithm="giac")

[Out]

-b*arctan(a*x/sqrt(a*b))/(sqrt(a*b)*a) + x/a

Mupad [B] (verification not implemented)

Time = 5.77 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.74 \[ \int \frac {1}{a+\frac {b}{x^2}} \, dx=\frac {x}{a}-\frac {\sqrt {b}\,\mathrm {atan}\left (\frac {\sqrt {a}\,x}{\sqrt {b}}\right )}{a^{3/2}} \]

[In]

int(1/(a + b/x^2),x)

[Out]

x/a - (b^(1/2)*atan((a^(1/2)*x)/b^(1/2)))/a^(3/2)